home *** CD-ROM | disk | FTP | other *** search
- Path: news.uiowa.edu!ozone!maclenna
- From: maclenna@ozone.uiowa.edu (Mark MacLennan)
- Newsgroups: comp.lang.c++
- Subject: Re: Major problem with strings.
- Date: 11 Mar 1996 07:16:06 GMT
- Organization: University of Iowa, Iowa City, IA, USA
- Distribution: world
- Message-ID: <4i0jvm$18q0@flood.weeg.uiowa.edu>
- References: <31438275.72DB@aol2.com> <4i0gn0$5g9@sam.inforamp.net>
- Reply-To: maclenna@cgrer.uiowa.edu(Mark MacLennan)
- NNTP-Posting-Host: ozone.cgrer.uiowa.edu
-
- In article <4i0gn0$5g9@sam.inforamp.net> rmorin@inforamp.net
- (Randy Charles Morin) writes:
- >In article <31438275.72DB@aol2.com>, Neil <neil@aol2.com> wrote:
- >>1 char *club="";
- >>2 club="/public_html/neil";
- >>3 strcat(club,argv[1]+5);
- >>4 strcat(club,"/");
- >
- >No, this just won't do. When you want a '/' slash in C, use two slashes. The
- >'/' is also used to denote an escape sequence (for special characters). Thus
- >your code should read...
- >
- >1 char *club="";
- >2 club="//public_html//neil";
- >3 strcat(club,argv[1]+5);
- >4 strcat(club,"//");
- >
- >Agrivar
-
- What nonsense! But then this can be expected from Randy Charles Morin.
- The reason the above doesn't work is that the char pointer club
- hasn't been allocated sufficient space to store the additional characters -
- indeed, it has been assigned to a string constant.
- By the way, the slash character "/" is NOT used to denote an escape
- sequence - the backslash character "\" serves this purpose.
-
- You know, Randy, you really should spend more time reading and writing
- some code than making these clueless postings. Maybe you can get your
- father to help chip in and buy you some C/C++ books.
-
- - MARK
-
-